package com.le.tester.book.effectivejava3rdchinese.secondReading.l38;

/**
 * createTime：2024-09-19 11:01
 * description：enum如果需要操作逻辑，使用接口接上enum，是一个很好的选择
 */
public enum BasicOperation implements Operation {

    PLUS("+") {
        public double apply(double x, double y) {
            return x + y;
        }
    };

    public final String symbol;

    BasicOperation(String symbol) {
        this.symbol = symbol;
    }
}
